#pragma once
#include <QFile>
#include <QDebug>

class BaseFile : public QObject
{
	Q_OBJECT
	
public:
    explicit BaseFile(const QString fileName, QObject* parent = nullptr);
	explicit BaseFile(QObject* parent = nullptr);
    virtual ~BaseFile() {};

    const QString fileName();
    void setFileName(const QString fileName);
	
    bool openFile(QFile::OpenMode flags = QFile::ReadWrite | QFile::Text);
	
    virtual void closeFile();
	
    virtual void writeFile(const QString& inData);

    virtual void readFile(QString& outData);
		
	
private:
    QString m_fileName = "";
    QFile m_file;
};
